package educationaladministrationsystem.CSM.Controller.StudentAndTeacher.Student;

import educationaladministrationsystem.Result.Result;
import educationaladministrationsystem.CSM.Mapper.Service.StudentAndTeacher.Student.StudentCourseSelectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("Student/CourseSelection/")
public class StudentCourseSelectionController {
    @Autowired
    private StudentCourseSelectionService studentCourseSelectionService;

    @GetMapping("/getAllCourse")
    public Result getAllCourse(@RequestParam String UID, @RequestParam int page, @RequestParam int pageNumber) {
        return Result.success(studentCourseSelectionService.getAllCourse(UID, page, pageNumber));
    }

    @GetMapping("/getPageSum")
    public Result getPageSum(@RequestParam String UID, @RequestParam int pageNumber) {
        return Result.success(studentCourseSelectionService.getPageSum(UID, pageNumber));
    }
}
